graph theory:connected graph